import React from 'react';
import { observer } from 'mobx-react';
import { Button } from 'antd';
import {WeaLocaleProvider} from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

export interface AdvancedButtonProps {
    advanced: {
        groups: any[],
        visible?: boolean,
        update: (params: any) => void
    };
    prefixCls?: string;
}

@observer
export default class AdvancedButton extends React.Component<AdvancedButtonProps, any>{
    static defaultProps = {
        prefixCls: 'coms-mode-top-title-ab'
    }
    handleVisibleChange = () => {
        const { advanced } = this.props;
        advanced.update({ visible: !advanced.visible });
    }
    render() {
        return (
            <Button onClick={this.handleVisibleChange}>{getLabel(347,'高级搜索')}</Button>
        )
    }
} 